package pe.com.rimac.portal.common.holder;

import javax.portlet.PortletRequest;

public class RequestHolder 
{
	private static ThreadLocal holder = new ThreadLocal();
	
    public static PortletRequest getPortletRequest()
    {
        PortletRequest portletRequest = (PortletRequest) holder.get();
        if (portletRequest == null)
        {
            throw new IllegalStateException("No portletRequest was found in RequestHolder (bound to thread)");
        }
        return portletRequest;
    }
    
    public static void setPortletRequest(PortletRequest portletRequest)
    {
        holder.set(portletRequest);
    }
}